﻿using AiQiuQuan.Sport.Core;
using AiQiuQuan.Sport.Model.Models;

namespace AiQiuQuan.Sport.WebApi.Services
{
    /// <summary>
    /// 第三方获取用户信息
    /// </summary>
    public interface IThirdUserInfoService : ITransientDependency
    {
        /// <summary>
        /// 微信公众号获取用户信息
        /// </summary>
        /// <param name="webAccessToken">网页授权accessToken</param>
        /// <param name="openId">用户openid</param>
        Task<UnaryResult<WxUserInfoDto>> GetWxMpUserInfoAync(string webAccessToken, string openId);

        /// <summary>
        /// 获取微信小程序用户电话
        /// </summary>
        /// <param name="code">小程充获取的动态口令</param>
        Task<UnaryResult<WxMiniProgramPhoneDto>> GetWxMiniprogramPhoneAsync(string code);

        /// <summary>
        /// 解密微信小程序前端获取的相关开放数据
        /// </summary>
        /// <typeparam name="TData">数据类型</typeparam>
        /// <param name="sessionKey">base64 sessionKey</param>
        /// <param name="iv">base64 iv</param>
        /// <param name="encryptData">base64 encryptDtata</param>
        UnaryResult<TData> DecryptWxMiniprogramData<TData>(string sessionKey, string iv, string encryptData);
    }
}